package ${cfg.packageName};

import com.ahccc.framework.mybatis.base.config.property.ServerProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/view")
public class ViewController {

   @Resource
   private ServerProperty serverProperty;

   @ModelAttribute
   public void initModel(Model model) {
      model.addAttribute("gateway", serverProperty.getGateway());
   }

   <#list config.tableInfoList as tableInfo>
   @RequestMapping("/${tableInfo.entityName?uncap_first}")
   public String ${tableInfo.entityName?uncap_first}() {
      return "view/${package.ModuleName}/${tableInfo.entityName?uncap_first}";
   }

   </#list>


}